bpo-35824: Update http.cookies._CookiePattern#11665
bpo-35824: Update http.cookies._CookiePattern#11665MeiK2333 wants to merge 3 commits intopython:masterfrom MeiK2333:master
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
|
Please open a bpo for this. I don't know if one exists for this. I am not an expert but googling gets me to https://tools.ietf.org/html/rfc2616#section-3.3.1 that has the date format for cookie expires attribute that mandates a space character after comma. The MDN links to general Date header field so I am not sure if it can be used for cookies. Set cookie date format RFC reference https://tools.ietf.org/html/rfc6265#section-4.1.1 Thanks for the report |
|
In the regular expression, I think a question mark is more usual; I suggest “\s?” rather than “\s{0,1}”. It would be good to add a test case. |
Yes, that is obviously a better way. Thanks for your guidance, I have modified the code and added the test. If I have other errors, please also point out. |
|
This might require a NEWS entry since the space is optional but I don't know how to word it though. https://devguide.python.org/committing/#what-s-new-and-news-entries |
|
Also the PR title needs to be modified to the required format before committing I hope in with "bpo-35824" prefixed. |
I think it can be written like this: If you think this works, I will add it and resubmit. |
LGTM. Please include "Patch by <full_name>" at the end. It will keep the PR green and can be rephrased if needed by the core dev while merging. Thanks |
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
Modified a regular expression to correctly parse Expires in Cookies
http.cookies.BaseCookie can't parse Expires in this format like
Expires=Thu,31 Jan 2019 05:56:00 GMT;(Less space afterThu,).I encountered this problem in actual use, Chrome, IE and Firefox can parse this string normally. Many languages, such as JavaScript, can also parse this data automatically.
I looked for mdn, and the examples they gave were spaces, but didn't do more.
I don't know the specification of pr and whether this pr is necessary. If it doesn't make sense, please close it.
English is not my native language; please excuse typing errors.
https://bugs.python.org/issue35824